<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex system_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-stretch justify-between system_fd0_0'>
          <view class='flex flex-wrap align-center system_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  system_fd0_0_c0_c0'>&#xe794;</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <text class='system_fd0_0_c1_c0'>{{$t('设置')}}</text>
          </view>
          <view class='flex align-center justify-end system_fd0_0_c2'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---基本设置flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch system_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch system_fd1_0'>
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/xtsz/cardAndSafe/cardAndSafe`">
            <text class='system_fd1_0_c0_c0'>{{$t('账号与安全')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c0'
            @tap.stop="popupShow1703648824934=true">
            <text class='system_fd1_0_c0_c0'>{{$t('语言切换')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
          <!-- <view class='flex flex-wrap align-center justify-between system_fd1_0_c0'>
            <text class='system_fd1_0_c0_c0'>{{$t('通知设置')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view> -->
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c3' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/xtsz/permissionSetting/permissionSetting`">
            <text class='system_fd1_0_c0_c0'>{{$t('权限管理')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
        </view>
        <view class='flex flex-wrap align-center system_fd1_1'>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch system_fd1_0'>
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/dlzc/agreements/agreements`">
            <text class='system_fd1_0_c0_c0'>{{$t('用户协议')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/dlzc/privacyPolicy/privacyPolicy`">
            <text class='system_fd1_0_c0_c0'>{{$t('隐私政策')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/xtsz/helpFeedback/helpFeedback`">
            <text class='system_fd1_0_c0_c0'>{{$t('帮助与反馈')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c3' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/xtsz/aboutUs/aboutUs`">
            <text class='system_fd1_0_c0_c0'>{{$t('关于我们')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
        </view>
        <view class='flex flex-wrap align-center system_fd1_1'>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch system_fd1_0'>
          <view class='flex flex-wrap align-center system_fd1_0_c0' @tap.stop="cleanUpFunc()">
            <text class='system_fd1_4_c0_c0'>{{$t('清除缓存')}}</text>
            <text class='system_fd1_4_c0_c1'>{{appRubbishCacheSize}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
          <view class='flex flex-wrap align-center system_fd1_0_c3' @tap.stop="updataFunc()">
            <text class='system_fd1_4_c0_c0'>{{$t('检查更新')}}</text>
            <text class='system_fd1_4_c0_c1'>{{appVersion}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
        </view>
        <view class='flex flex-wrap align-center system_fd1_1'>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch system_fd1_0'>
          <view class='flex flex-wrap align-center justify-between system_fd1_0_c3' @tap.stop="gozhuxiaoFunc()">
            <text class='system_fd1_4_c0_c0'>{{$t('注销账号')}}</text>
            <text class='fu-iconfont2  system_fd1_0_c0_c1'>&#xE7F2;</text>
          </view>
        </view>
      </view>

      <!---基本设置flex布局结束-->
      <benben-popup v-model="popupShow1703648824934" :mask="true" :mask-close-able="false" mode='bottom' :z-index='999'>
        <!---flex布局flex布局开始-->
        <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout system_flex_2">
          <view class='flex flex-wrap align-center justify-between system_fd2_0'>
            <text class='system_fd2_0_c0'>{{$t('选择语言')}}</text>
            <image class='system_fd2_0_c1' mode="aspectFit" :src='STATIC_URL+"100.png"'
              @tap.stop="popupShow1703648824934=false"></image>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch system_fd2_1'>
            <benben-select-diy ref="showSelectPopup1703649302192" class-name='flex flex-direction align-stretch flex'
              :items.sync="leugaType" v-model="language_id" default-type="value" default-label="name"
              :allow-cancel='false' type="radio" :disabled='false'>
              <template v-for='(item,key0) in leugaType'>
                <view v-if="item.isSelected" class='flex align-center justify-between flex system_fd2_1_c0_c0'
                  :key="key0" @tap="$refs.showSelectPopup1703649302192.tapHandle(key0)">
                  <view class='flex flex-wrap align-center'>
                    <image class='system_fd2_1_c0_c0_c0_c0' mode="aspectFit" :src='item.image'></image>
                    <text class='system_fd2_0_c0'>{{item.name}}</text>
                  </view>
                  <image class='system_fd2_1_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
                </view>
                <view v-else class='flex align-center justify-between flex system_fd2_1_c0_c0' :key="key0"
                  @tap="$refs.showSelectPopup1703649302192.tapHandle(key0)">
                  <view class='flex flex-wrap align-center'>
                    <image class='system_fd2_1_c0_c0_c0_c0' mode="aspectFit" :src='item.image'></image>
                    <text class='system_fd2_0_c0'>{{item.name}}</text>
                  </view>
                  <image class='system_fd2_1_c0_c0_c1' mode="aspectFit" :src='STATIC_URL+"96.png"'></image>
                </view>
              </template></benben-select-diy>
          </view>
          <view class='flex flex-wrap align-center justify-center system_fd2_2'>
            <button class='system_fd2_2_c0' @tap.stop="switchLaugn">{{$t('确定')}}</button>
          </view>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>
      <benben-popup v-model="popupShow1656992350800" :mask="true" :mask-close-able="true" mode='center'>
        <!---退出登录flex布局开始-->
        <view class="flex flex-direction flex-wrap align-center system_flex_3" @tap.stop="popupShow1650940432200=true">
          <text class='system_fd3_0'>{{$t('提示')}}</text>
          <text class='system_fd3_1'>{{$t('确定退出当前账号？')}}</text>
          <view class='flex align-center system_fd3_2'>
            <button class='system_fd3_2_c0' @tap.stop="popupShow1656992350800=false"
              open-type="contact">{{$t('取消')}}</button>
            <button class='system_fd3_2_c1' @tap.stop="logOutFunc()" open-type="contact">{{$t('确定')}}</button>
          </view>
        </view>

        <!---退出登录flex布局结束-->

      </benben-popup>
      <view class="flex flex-wrap align-center justify-center benben-position-layout flex system_flex_4"
        @tap.stop="popupShow1656992350800=true">
        <text class='system_fd4_0'>{{$t('退出登录')}}</text>

      </view>
      <view :style="{height: '110rpx'}"></view>
      <benben-popup v-model="popupShow1679541357000" :mask="true" :mask-close-able="true" mode='center'>
        <!---清除缓存flex布局开始-->
        <view class="flex flex-direction flex-wrap align-center system_flex_5" @tap.stop="popupShow1650940432200=true">
          <text class='system_fd5_0'>{{$t('提示')}}</text>
          <text class='system_fd5_1'>{{$t('确定要清除本地缓存？')}}</text>
          <view class='flex align-center system_fd5_2'>
            <button class='system_fd5_2_c0' @tap.stop="popupShow1679541357000=false">{{$t('取消')}}</button>
            <button class='system_fd5_2_c1' @tap.stop="cleanUpFunc()">{{$t('确定')}}</button>
          </view>
        </view>

        <!---清除缓存flex布局结束-->

      </benben-popup>
      <app-update ref="update"></app-update>


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "popupShow1679541357000": false,
        "popupShow1656992350800": false,
        "popupShow1703648824934": false,
        "dataMessage": {
          "aid": "",
          "user_nickname": "",
          "user_avatar": "",
          "user_mobile": "",
          "cancel_type": "",
          "create_time": "",
          "status": "",
          "cancel_reason": "",
          "cancel_type_text": ""
        },
        "leugaType": [{
          "name": global.i18n.t("简体中文"),
          "value": "zh-Hans",
          "image": require('@/static/images/zhong.png'),
          "laugu": 'zh-Hans'
        }, {
          "name": global.i18n.t("繁体中文"),
          "value": "zh-Hant",
          "image": require('@/static/images/fan.png'),
          "laugu": 'zh-Hant'
        }, {
          "name": global.i18n.t("English"),
          "value": "English",
          "image": require('@/static/images/en.png'),
          "laugu": 'English'
        }],
        "language_id": "",
        "language_label": global.i18n.t("简体中文")
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      appVersion() {
        // 获取版本号
        return this.$store.state.appVersion
      },
      appRubbishCacheSize() { // 获取缓存大小
        return this.$store.state.appRubbishCacheSize
      }
    },
    watch: {},
    onLoad(options) {
      this.language_id = global.locale
      this.language_label = this.leugaType.filter(item => item.value == this.language_id)[0].name
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.$store.dispatch('getAppVersion') // 更新版本号
      this.$store.dispatch('getAppCache') // 更新缓存大小
      this.getLogoutFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      // 切换语言
      switchLaugn() {
        this.popupShow1703648824934 = false
        uni.$emit("languages");
        let obj = {
          // name: this.language_label,
          value: this.language_id
        }
        console.log('222', obj)
        uni.setStorageSync('lauange', this.language_id)
        // return;
        this.$store.commit('setLocale', {
          "locale": obj
        })
        // console.log('global.locale',global.locale)
      },
      //退出登录
      logOutFunc() {
        this.$store.commit('logout')
        this.$urouter.reLaunch(`/pages/tabBar/login/login`);
      },
      //获取注销状态1提交 3驳回
      gozhuxiaoFunc() {
        if (this.dataMessage.status == '1') {
          this.$urouter.navigateTo(`/pages/xtsz/logOutSubmit/logOutSubmit?type=1&status=${this.dataMessage.status}`);
        } else if (this.dataMessage.status == '0') {
          this.$urouter.navigateTo(`/pages/xtsz/CancelAccount/CancelAccount`);
        } else if (this.dataMessage.status == '3') {
          this.$urouter.navigateTo(`/pages/xtsz/logOutSubmit/logOutSubmit?type=1&status=${this.dataMessage.status}`);
        } else if (this.dataMessage.status == '2') {
          this.$message.info('账号已注销');
        }
      },
      //获取注销状态
      async getLogoutFunc() {
        //请求方法
        //数据验证

        let datadataMessage = await this.$api.get(global.apiUrls.post637c4deb97aa9, {

        });

        if (datadataMessage.data.code != 1) {
          // this.$message.info(datadataMessage.data.msg);
          return
        }
        let infodataMessage = datadataMessage.data;
        this.dataMessage = infodataMessage.data

      },
      //清除缓存
      cleanUpFunc() {
        this.$store.dispatch('appClearCache')
        this.popupShow1679541357000 = false;
      },
      //App更新
      updataFunc() {
        this.$util.debounce(
          () => {
            this.$refs.update.checkAppUpdate()
          },
          1000,
          true
        )
        // this.$message.info('已是最新版本');
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(247, 243, 237, 1);
    background-size: 100% auto;
  }

  .system_flex_0 {
    border-bottom: 1px solid rgba(232, 229, 216, 1);
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .system_fd0_0_c2 {
    padding: 0rpx 0rpx 0rpx 0rpx;
    width: 100rpx;
  }

  .system_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
  }

  .system_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 400;
    color: #333;
  }

  .system_fd0_0_c0 {
    width: 100rpx;
  }

  .system_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .system_flex_1 {
    font-size: 32rpx;
  }

  .system_fd1_4_c0_c1 {
    font-size: 28rpx;
    color: rgba(102, 102, 102, 1);
    margin: 0rpx 24rpx 0rpx auto;
  }

  .system_fd1_4_c0_c0 {
    font-size: 32rpx;
    color: var(--benbenFontColor0);
  }

  .system_fd1_1 {
    background: rgba(235, 228, 217, 1);
    height: 20rpx;
    background-size: 100% auto !important;
    margin: 0rpx 32rpx 0rpx 32rpx;
    border-radius: 10rpx;
  }

  .system_fd1_0_c3 {
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .system_fd1_0_c0_c1 {
    font-size: 26rpx;
    color: rgba(191, 191, 191, 1);
  }

  .system_fd1_0_c0_c0 {
    font-size: 32rpx;
    color: #333333;
    font-weight: 400;
    line-height: 32rpx;
  }

  .system_fd1_0_c0 {
    border-bottom: 1px solid rgba(232, 229, 216, 1);
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .system_fd1_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .system_flex_2 {
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
    border-radius: 40rpx 40rpx 0rpx 0rpx;
    padding: 42rpx 0rpx 32rpx 0rpx;
  }

  .system_fd2_2_c0 {
    background: rgba(145, 47, 34, 1);
    border-radius: 40rpx;
    width: 500rpx;
    line-height: 80rpx;
    font-size: 32rpx;
    color: #fff;
  }

  .system_fd2_2 {
    margin: 12rpx 0rpx 0rpx 0rpx;
  }

  .system_fd2_1_c0_c0_c1 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .system_fd2_1_c0_c0_c0_c0 {
    width: 88rpx;
    height: 88rpx;
    border-radius: 100rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .system_fd2_1_c0_c0 {
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .system_fd2_1 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .system_fd2_0_c1 {
    width: 42rpx;
    height: 42rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .system_fd2_0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
  }

  .system_fd2_0 {
    padding: 0rpx 24rpx 24rpx 24rpx;
  }

  .system_flex_3 {
    background: #fff;
    width: 540rpx;
    border-radius: 40rpx;
  }

  .system_fd3_2_c1 {
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    background: #fff;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 16rpx 0rpx;
    font-size: 32rpx;
    color: rgba(145, 47, 34, 1);
    width: 268rpx;
  }

  .system_fd3_2_c0 {
    border-top: 1px solid #eee;
    background: #fff;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 0rpx 16rpx;
    font-size: 32rpx;
    color: rgba(153, 153, 153, 1);
    padding: 0rpx 103rpx 0rpx 103rpx;
  }

  .system_fd3_2 {
    margin: 37rpx 0rpx 0rpx 0rpx;
  }

  .system_fd3_1 {
    line-height: 44rpx;
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
  }

  .system_fd3_0 {
    font-size: 36rpx;
    font-weight: 800;
    line-height: 44rpx;
    color: #333333;
    margin: 40rpx 0rpx 40rpx 0rpx;
  }

  .system_flex_4 {
    background: rgba(235, 228, 217, 1);
    width: 750rpx;
    height: 110rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto !important;
  }

  .system_fd4_0 {
    color: #912F22;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .system_flex_5 {
    background: #fff;
    width: 600rpx;
    border-radius: 40rpx;
    text-align: center
  }

  .system_fd5_2_c1 {
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    background: #fff;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 16rpx 0rpx;
    font-size: 32rpx;
    color: rgba(145, 47, 34, 1);
    width: 268rpx;
  }

  .system_fd5_2_c0 {
    border-top: 1px solid #eee;
    background: #fff;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 0rpx 16rpx;
    font-size: 32rpx;
    color: rgba(153, 153, 153, 1);
    padding: 0rpx 103rpx 0rpx 103rpx;
  }

  .system_fd5_2 {
    margin: 37rpx 0rpx 0rpx 0rpx;
  }

  .system_fd5_1 {
    line-height: 44rpx;
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
  }

  .system_fd5_0 {
    font-size: 36rpx;
    font-weight: 800;
    line-height: 44rpx;
    color: #333333;
    margin: 40rpx 0rpx 40rpx 0rpx;
  }
</style>
